﻿using ESRI.ArcGIS.ADF.BaseClasses;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using PlanningGIS.Framework;

namespace PlanningGIS.DataConvert
{
    /// <summary>
    /// 矢量数据按规则入库
    /// </summary>
    public class CmdDLGImport: BaseCommand
    {        
        /// <summary>
        /// 构造函数
        /// </summary>
        public CmdDLGImport()
        {
            base.m_caption = "按规则入库";
            base.m_toolTip = base.m_caption;
        }
        /// <summary>
        /// 应用程序框架
        /// </summary>
        IApplication m_Application = null;

        /// <summary>
        /// 入库窗体
        /// </summary>
        FrmDLGImp frmImp = null;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="hook"></param>
        public override void OnCreate(object hook)
        {
            if (m_Application == null)
                m_Application = hook as IApplication;
        }

        /// <summary>
        /// 是否可用
        /// </summary>
        public override bool Enabled
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// 点击事件
        /// </summary>
        public override void OnClick()
        {
            if (frmImp == null || frmImp.IsDisposed)
            {
                frmImp = new FrmDLGImp();
                frmImp.Show((m_Application as IFramework).MdiForm);
            }
            else
            {
                frmImp.BringToFront();
            }
        }


    }
}
